﻿using NetTopologySuite.Features;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Observer
{
    public class FeatureSubject : ISubject
    {
        private readonly List<IObserver> _observers = new List<IObserver>();

        public IFeature Feature { get; set; }
        public ChangeStatus ChangeStatus { get; set; }

        public void Attach(IObserver observer) => _observers.Add(observer);
        public void Detach(IObserver observer) => _observers.Remove(observer);

        public void Notify()
        {
         
            foreach (var observer in _observers)
            {
                observer.Update(Feature, ChangeStatus);
            }
        }
    }
}
